package com.ziyun.erp.web;

import com.ziyun.admin.web.config.ShiroConfig;

import lombok.extern.slf4j.Slf4j;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.bus.jackson.RemoteApplicationEventScan;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;



@Slf4j
@ComponentScan(basePackages= {"com.cloud.bus.*","com.service.cache.*","io.renren.*","com.ziyun.erp.*","com.ziyun.admin.web.*",
		"com.service.pay.*","com.service.utils.*","com.service.ucenter.*","com.service.timer.*"},
				excludeFilters={@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value=ShiroConfig.class)
})
@RemoteApplicationEventScan(basePackages = "com.cloud.bus.event.*")
@MapperScan(basePackages = {"io.renren.modules.*.dao","com.ziyun.erp.modules.**.dao","com.service.ucenter.dao.mapper"})
@EnableFeignClients(basePackages = {"com.service.ucenter.api","com.service.order.api","com.service.goods.api","com.service.timer.api"})
@EnableEurekaClient
@SpringBootApplication
public class ZiYunErpApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
		SpringApplication.run(ZiYunErpApplication.class, args);
		log.info(">>>>> Ziyun-ERP 启动完成 <<<<<");
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(ZiYunErpApplication.class);
	}
}
